
*AUHORS: SCHIEL, REBECCA, JONATHAN POWELL, AND URSULA DAXECKER*
*TITLE: PEACEKEEPING AND MUTINIES IN AFRICAN SENDING STATES*
*JOURNAL: FORTHCOMING IN FOREIGN POLICY ANALYSIS*
*NAME DOFILE: SPD REPLICATION*
*DATE DOFILE: October 15, 2019* 
*CORRECTED DOFILE: Februrary 1 2020*
*DATA FILES PROVIDED: (1) SPD_countryyear.dta, (2) SPD_countrymonth.dta ///
*(3) SPD_UN_missionyear (4) SPD_nonUN_missionyear*

*PLEASE NOTE: User must first set directory to replication data by typing cd ""*

*********************************
*TABLES 1&2, FIGURE 2 IN ARTICLE*
*********************************

*COUNTRY-YEAR DATA FOR MAIN RESULTS IN ARTICLE*
use "SPD_countryyear.dta", clear
tsset cowcode year

*TABLE 1*
*Model 1, all PK contributions*
logit mutinydum l.allPKO   l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy  i.year if simult==0, cluster(cowcode)
est store m1
*Model 2, distinguish UNPK and non-UN PK contributions*
logit mutinydum l.troops l.nonUN l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy i.year if simult==0, cluster(cowcode)
est store m2
*Model 3, average over 3 years of PK contributions*
logit mutinydum l.troops3yr l.nonUN3yr l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy i.year if simult==0, cluster(cowcode)
est store m3
*Model 4, logged UN and non-UN PK contributions*
logit mutinydum l.lntroops l.lnnonUN l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy i.year if simult==0, cluster(cowcode)
est store m4
esttab m1 m2 m3 m4 using "Tab1.rtf", mtitles("(1) All PK" "(2) UN and non-UN" "(3) 3 year total" "(4) Logged PK")  drop (_cons *.year ) order(*.allPKO *.troops *.troops3yr *.lntroops  *.nonUN *.nonUN3yr *.lnnonUN) stats(aic bic N)  se star(+ 0.10 * 0.05 ** .01) nocon title(Table 1: Country-year logit regression of mutiny, 1990-2011) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*FIGURE 2*
*Substantive effect of non UN troops, +-2SD above the mean, model 2 table 1*
set scheme plotplain
gen pipe = "|"
gen where=0
egen nonUNtag=tag(nonUN)if nonUN<=2500
logit mutinydum l.troops l.nonUN   l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive mutinypy l.coupattdum i.year if simult==0, cluster(cowcode)
margins, atmeans at(l.nonUN=(0(250)2500)) vsquish
marginsplot,   addplot(scatter where nonUN if nonUNtag==1, ms(none) mlabel(pipe) xlabel(0[500]2500) ylabel(0(.05).1) xsc(r(0(500)2500)))  title("")  recast(line) plot1opts(lpattern() lcolor(green) ) recastci(rarea)  legend(off) ciopts(color(gs15)) xtitle("Non-UN peacekeeper contributions", size(small)) ytitle("Probability of mutiny", size(small)) 
drop pipe
drop where
drop nonUNtag

*TABLE 2*
*Models 5&6, PKO contributions and effect on mutinies as joint process*
*Please note these estimates are slightly different and the table has been updated**
 cmp (lnallPKO= l.allPKOdum l.allPKOreceive l.ln_milexsoldierconst l.coupproofing  l.lncgdp  l.polity l.durable mutinypy i.year) (mutinydum=l.troops l.nonUN l.ln_milexsoldierconst l.coupproofing  l.lncgdp  l.polity l.durable  l.lnpop l.allPKOreceive l.coupattdum mutinypy i.year ) if simult==0, cluster(cowcode) ind($cmp_cont $cmp_probit) 
est store cmp
esttab cmp using "Tab2.rtf", drop (_cons *.year) mtitles("(1) DV=PK contributions" "(2) DV=Mutiny") order(*.troops  *.nonUN ) obslast stats(aic bic N) se star(+ 0.10 * 0.05 ** 0.01) nocon title(Table 2: Country-year CMP regression of mutiny, 1990-2011) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 
 
**********
*APPENDIX*
**********

*APPENDIX A1, descriptive statistics for country-year data*
use "SPD_countryyear.dta", clear
estpost sum mutinydum allPKO troops troops3yr troops100 lntroops total nonUN nonUN3yr nonUN100 lnnonUN ln_milexsoldierconst coupproofing polity durable lnpop lncgdp allPKOreceive coupattdum mutinypy simult dwyer loyal unmatch allPKOdum
esttab using "TabA1.rtf", cell("mean (fmt(3)) sd(fmt(3)) min (fmt(3))  max (fmt(3))") star rtf label replace

*APPENDIX A2, ROBUSTNESS YEARLY MODELS*
use "SPD_countryyear.dta", clear
tsset cowcode year
*TABLE A2*
*Model A2.1, Only robust contributions*
logit mutinydum l.troops100 l.nonUN100   l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive mutinypy i.year if simult==0, cluster(cowcode)
est store a21
*Model A2.2, add  dummy for West African countries*
logit mutinydum l.troops l.nonUN   l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum dwyer mutinypy i.year if simult==0, cluster(cowcode)
est store a22
*Model A2.3, include simultaneous countries with simultanous contributions and control for these contributions*
*show the two obersvations with mutinies and making simultaneous contributions*
list cowcode year country troops  nonUN mutinydum if simult==1&mutinydum==1
logit mutinydum l.troops l.nonUN   l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum simult mutinypy i.year, cluster(cowcode)
est store a24
*Model A2.4, fixed effects*
xtlogit mutinydum l.troops l.nonUN   l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum mutinypy i.year if simult==0 , fe
est store a25
esttab a21 a22 a24 a25  using "TabA2.rtf", mtitles("(A2.1) Robust contributions" "(A2.2) All UN" "(A2.3) Dwyer sample" "(A2.4) FE") obslast drop (*.year ) order(*.troops *.troops100  *.nonUN *.nonUN100) stats(aic bic N) se star(+ 0.10 * 0.05 ** 0.01) nocon title(Table A2: Country-year logit regression of mutiny, 1990-2011) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*APPENDIX A3, ROBUSTNESS MONTHLY MODELS*
*USE MONTHLY DATASET*
use "SPD_countrymonth.dta", clear
tsset cowcode ym
*TABLE A3*
*Model A3.1, UN and non-UN*
logit mutiny_allmil l12.troops l12.nonUN l12.ln_milexsoldierconst l12.coupproofing  l12.lncgdp  l12.polity l12.durable  l12.lnpop l12.allPKOreceive l12.coupatt mutinyallpy i.year if simult==0, cluster(cowcode)
est store a31
*Model A3.2, logged UN and non-UN PK*
logit mutiny_allmil l12.lntroops l12.lnnonUN l12.ln_milexsoldierconst l12.coupproofing  l12.lncgdp  l12.polity l12.durable  l12.lnpop l12.allPKOreceive l12.coupatt mutinyallpy i.year if simult==0, cluster(cowcode)
est store a32
*Model A3.3,Short-term effect of UNPK contributions, 6 months*
logit mutiny_allmil l6.troops l12.nonUN l12.ln_milexsoldierconst l12.coupproofing  l12.lncgdp  l12.polity l12.durable  l12.lnpop l12.allPKOreceive l12.coupatt mutinyallpy i.year if simult==0, cluster(cowcode)
est store a33
*Model A3.4,Short-term effect of logged UNPK contributions, 6 months*
logit mutiny_allmil l6.lntroops l12.lnnonUN l12.ln_milexsoldierconst l12.coupproofing  l12.lncgdp  l12.polity l12.durable  l12.lnpop l12.allPKOreceive l12.coupatt mutinyallpy i.year if simult==0, cluster(cowcode)
est store a34
esttab a31 a32 a33 a34  using "TabA3.rtf", mtitles("(A3.1 UN and non-UN" "(A3.2) Logged" "(A3.3) 6-month lag" "(A3.4) 6-month logged" ) obslast drop (_cons *.year) order(*.troops *.lntroops  *.nonUN *.lnnonUN) stats(aic bic N) se star(+ 0.10 * 0.05 ** 0.01) nocon title(Table A3: Country-month logit regression of mutiny, 1990-2011) nonumbers label  b(%10.5f) r2 nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*APPENDIX 4, MISSION-SPECIFIC MODELS*
*USE MISSION-SPECIFIC DATASETS*
*UN MISSIONS*
use "SPD_UN_missionyear.dta", clear
tsset missioncode year
*Model A4.1, add mission specific variables for PKO deaths, conflict lethality, and mission duration* 
logit mutiny_allmil l.troop l.deaths_conflict duration mutinypy l.ln_milexsoldierconst l.coupproofing l.lncgdp  l.polity  l.lnpop if totaltroop>0, cluster(cowcode)
est store a41
esttab a41 using "Tab4.1.rtf",  obslast drop (_cons  ) order() stats(aic bic N) se star(+ 0.10 * 0.05) nocon title(Table A4.1: UN mission-year logit regression of mutiny, 1990-2011) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*NON-UN MISSIONS*
use "SPD_nonUN_missionyear.dta", clear
tsset missioncode year
*Model A4.2, include non-UN troops and conflict variables*
logit mutiny_allmil nonUN deaths_conflict duration mutinypy ln_milexsoldierconst coupproofing lncgdp  polity  lnpop , cluster(cowcode)
est store a42
esttab a42 using "TabA4.2.rtf",  obslast drop (_cons  ) order() stats(aic bic N) se star(+ 0.10 * 0.05) nocon title(Table A4.2: Non-UN mission-year logit regression of mutiny, 1990-2011) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*APPENDIX 5-9, USE YEARLY DATASET*
use "SPD_countryyear.dta", clear
*APPENDIX A5, rare events*
*Model A5.1, Rare events logit, split UN and non-UN*
firthlogit mutinydum troops_l nonUN_l ln_milexsoldierconst_l coupproofing_l polity_l durable_l lnpop_l lncgdp_l allPKOreceive coupattdum_l  mutinypy i.year if simult==0
est store a51
esttab a51 using "TabA5.rtf", mtitles("(1) All PK") obslast drop (_cons *.year ) stats(aic bic N) se star(+ 0.10 * 0.05 ** 0.01) nocon title(Table A5) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*APPENDIX A6, coup attempt models*
*Model A6.1, all PK contributions
logit coupattdum l.allPKO l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive coupattpy i.year, cluster(cowcode)
est store a61
*Model A6.2, distinguish UN and non-UN contribution*
logit coupattdum l.troops l.nonUN l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive coupattpy i.year, cluster(cowcode)
est store a62
**Model A6.3, average over 3 years of PK contributions*
logit coupattdum l.troops3yr l.nonUN3yr l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive coupattpy i.year, cluster(cowcode)
est store a63
*logged contributions*
logit coupattdum l.lntroops l.lnnonUN l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive coupattpy i.year, cluster(cowcode)
est store a64
esttab a61 a62 a63 a64 using "TabA6.rtf", mtitles("(1) All PK" "(2) UN and non-UN" "(3) 3 year total" "(4) Logged PK") obslast drop (_cons *.year ) order(*.allPKO *.troops *.troops3yr *.lntroops  *.nonUN *.nonUN3yr *.lnnonUN) stats(aic bic N) se star(+ 0.10 * 0.05 ** 0.01) nocon title(Table A6) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*APPENDIX A7, ethnic loyalty* 
logit mutinydum l.troops l.nonUN l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy loyal i.year if simult==0, cluster(cowcode)
est store a71
*Unmatched Officer Corps
logit mutinydum l.troops l.nonUN l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy  unmatch i.year if simult==0, cluster(cowcode)
est store a72
esttab a71 a72 using "TabA7.rtf", obslast drop (_cons *.year ) stats(aic bic N) se star(+ 0.10 * 0.05 ** 0.01) nocon title(Table A7) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*APPENDIX A8, De Bruin's measure of counterbalancing 
logit mutinydum l.troops l.nonUN l.ln_milexsoldierconst l.cbcount l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy i.year if simult==0, cluster(cowcode)
est store a81
esttab a81 using "TabA8.rtf", mtitles("(1) UN and non-UN") obslast drop (_cons *.year ) stats(aic bic N) se star(+ 0.10 * 0.05 ** 0.01) nocon title(Table A8) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

*APPENDIX A9, West Africa*
logit mutinydum l.troops l.nonUN l.ln_milexsoldierconst l.coupproofing l.polity l.durable l.lnpop l.lncgdp allPKOreceive l.coupattdum  mutinypy wafrica i.year if simult==0, cluster(cowcode)
est store a91
esttab a91 using "TabA9.rtf", mtitles("(1) UN and non-UN") obslast drop (_cons *.year )  stats(aic bic N) se star(+ 0.10 * 0.05 ** .01) nocon title(Table 1: Country-year logit regression of mutiny, 1990-2011) nonumbers label  b(%10.5f)  nonotes addnotes("Standard errors clustered on country in parentheses." "+ p<.1 *<.05 **<.01") replace 

